package com.bgrconsulting.stockorderentry.service.converter;

import java.util.Date;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.bgrconsulting.stockorderentry.service.model.Order;
import com.bgrconsulting.stockorderentry.service.model.LegDetails;

@XmlRootElement(name = "order")
public class OrderConverter {
	
	private Order enity;
	
	public OrderConverter(Order order) {
		enity = order;
	}
	
	public OrderConverter() {
		enity = new Order();
	}
	
	@XmlElement(name = "orderId")
	public int getOrderId() {
		return enity.getOrderId();
	}
	
	
	@XmlElement(name = "orderPlacedTime")
	public Date getOrderPlacedTime() {
		return enity.getOrderPlacedTime();
	}
	
	
	@XmlElement(name = "orderValue")
	public Double getOrderValue() {
		return enity.getOrderValue();
	}
	
	
	@XmlElement(name = "orderStatus")
	public String getOrderStatus() {
		return enity.getOrderStatus();
	}
	
	
	@XmlElement(name = "orderType")
	public String getOrderType() {
		return enity.getOrderType();
	}
	
	
	@XmlElement(name = "orderTerm")
	public String getOrderTerm() {
		return enity.getOrderTerm();
	}
	
	
	@XmlElement(name = "priceType")
	public String getPriceType() {
		return enity.getPriceType();
	}
	
	
	@XmlElement(name = "limitPrice")
	public Double getLimitPrice() {
		return enity.getLimitPrice();
	}
	
	
	@XmlElement(name = "stopPrice")
	public Double getStopPrice() {
		return enity.getStopPrice();
	}
	
	
	@XmlElement(name = "legDetails")
	public LegDetailsConverter getLegDetails() {
		return new LegDetailsConverter(enity.getLegDetails());
	}
	
	@XmlElement(name = "allOrNone")
	public boolean getAllOrNone() {
		return enity.getAllOrNone();
	}

}
